<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <base href="<%=request.getContextPath()%>/"/>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <script src="static/js/jquery-2.1.1.min.js"></script>
    <%@include file="../layUI.jsp"%>
</head>
<body>
<form action="doUser?action=userUpdatePwd" method="post" id="forms">
    ID<input type="text" value="${User.id}" name="id" readonly>
    姓名<input type="text" value="${User.userName}" name="userName" readonly>
    密码<input type="password" value="${User.userPassword}" name="userPassword">
    <input type="button" value="修改完成" class="layui-btn" onclick="UpdatePwd()">
</form>
<script>
    $(function () {
        var flag = '${param.flag}'
        if(flag=="false"){
            alert("修改密码失败！");
        }
    })
    //修改密码验证
    function UpdatePwd() {
      var userPassword =  $("[name=userPassword]").val();
      if(userPassword=="" ||userPassword==null){
          alert("密码不能为空！")
          return;
      }else if(userPassword.length<3){
          alert("密码不能少于3位！");
          return;
      }else{
          $("#forms").submit();
      }
    }
</script>
</body>
</html>
